﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UniversaleMain.Master" AutoEventWireup="true" CodeBehind="Comment.aspx.cs" Inherits="FYPDemo.Comment" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   
       <h1 class="h1_title">Comments</h1>
   
    <div>
        <asp:GridView ID="CommentGrid" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" PageSize="5" onrowcommand="Comment_RowCommand" DataKeyNames="ID"
            onpageindexchanging="CommentGrid_PageIndexChanging" CellPadding="4" 
            ForeColor="#333333" GridLines="None">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:TemplateField HeaderText="Author">
                    <ItemTemplate>
                        <table>
                            <tr>
                                <asp:Label ID="Author" runat="server" Width="100px"><%#Eval("CreatedBy") %></asp:Label>                                
                            </tr>
                            <tr>
                                <td>
                                    <asp:Image ID="DisplayPicture" runat="server" ImageUrl='<%#Eval("ImagePath") %>' Height="70px" Width="75px" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>                    
                </asp:TemplateField>

                <asp:TemplateField HeaderText = "Comment" >
                        <ItemTemplate>
                        <asp:Label ID="lblNo" runat="server" Text="<%# Container.DataItemIndex + 1 %>" Font-Bold="true" Font-Underline="true"></asp:Label>
                            <table>
                                <tr>
                                    <td>
                                        
                                    </td>
                                </tr>

                                <tr>
                                    <td>
                                        <asp:Label ID="lblComment" runat="server" Width="500px"><%#Eval("Comment") %></asp:Label>
                                    </td>
                                </tr>

                                <tr>
                                    <td align="right">
                                        <asp:LinkButton ID="lbtReply" runat="server" Text="Reply" CommandArgument="<%# ((GridViewRow) Container).RowIndex  %>" CommandName="Reply"></asp:LinkButton>
                                    </td>

                                    <td align="right">
                                        <asp:LinkButton ID="lbtDelete" runat="server" Text="Delete" CommandArgument="<%# ((GridViewRow) Container).RowIndex  %>" CommandName="Delete"></asp:LinkButton>
                                    </td>

                                </tr>
                            </table>
                        </ItemTemplate>
                    </asp:TemplateField>
            </Columns>
            <EditRowStyle BackColor="#7C6F57" />
            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#E3EAEB" />
            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F8FAFA" />
            <SortedAscendingHeaderStyle BackColor="#246B61" />
            <SortedDescendingCellStyle BackColor="#D4DFE1" />
            <SortedDescendingHeaderStyle BackColor="#15524A" />
        </asp:GridView>
        <div style="float:right; margin:5px 20px 5px 0px;">
            <asp:Button ID="btnBack" runat="server" Text="Back" CssClass="buttonbg" 
                onclick="btnBack_Click" />
        </div>
        <div class="reply_comment">
            <asp:Label ID="lblAddCommentDescription" runat="server" Text="Add Comment here"></asp:Label>
            <br />
            <asp:TextBox ID="txtAddComment" runat="server" TextMode="MultiLine" Height="150px" Width="450px"></asp:TextBox>
            <br />
            <asp:Button ID="btnAddComment" runat="server" Text="New Comment" 
                onclick="btnAddComment_Click" Enabled="false" CssClass="buttonbg" />
        </div>
    </div>
</asp:Content>
